package com.feri.findlife.controller;

import com.feri.findlife.service.intf.ObjstorageService;
import com.feri.findlife.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @program: FindLife
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2020-12-22 09:50
 */
@RestController
@RequestMapping("api/file/")
public class ObjstorageController {
    @Autowired
    private ObjstorageService service;

    //文件上传
    @PostMapping("upload.do")
    public R upload(@RequestParam("file") MultipartFile file){
        return service.uploadV1(file);
    }
    //文件上传
    @PostMapping("uploadpic.do")
    public R upload2(@RequestParam("file") MultipartFile file){
        return service.uploadV2(file);
    }
    //文件上传
    @PostMapping("uploadmorepic.do")
    public R upload2(@RequestParam("files") MultipartFile[] files){
        return service.uploadBatch(files);
    }

}
